<?php
/**
 * Created by PhpStorm.
 * User: Emmett
 * Date: 2016/8/30
 * Time: 17:30
 */

namespace Business\Home;

use Business\StrategyBase;

abstract class HomeStrategyBase extends StrategyBase implements iHomeStrategy
{
    public function index()
    {
        $depart = fc_get_depart(session('user_auth')["id"]);

        if (!empty($depart)) {
            $depart_name_str = $depart['name'];
            while (!empty($depart['pid'])) {
                $depart = fc_get_department($depart['pid']);
                $depart_name_str = $depart['name'] . ' - '.$depart_name_str;
            };
//            $depart_name_str = substr($depart_name_str, 1);
            $this->mvc_controller->assign('depart_name_str', $depart_name_str);
        }
    }

}